<!--
 Copyright (C) 2011 Software Languages Lab, Vrije Universiteit Brussel

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Test Direct Proxies</title>
	<meta name="author" content="Tom Van Cutsem">
</head>

<script>
function load(){} // stub
function print(text) {
  var tt = document.createElement("tt");
  var txt = document.createTextNode(text);
  tt.appendChild(txt);
  if (/^!.*/.test(text)) {
    tt.style.color = "red";
  }
  var report = document.getElementById("report");
  report.appendChild(tt);
  report.appendChild(document.createElement("br"));
}
</script>
<script src="setProperty.js"></script>
<body onload="runTests()">
  <div style="border: 1px solid grey; padding: 5px">
  <p>
    This file tests whether the <a href="http://wiki.ecmascript.org/doku.php?id=strawman:refactoring_put">proposed refactoring for [[Put]]</a> (i.e. property assignment) is semantically equivalent to the existing ES5 semantics for [[Put]]. Below, you should see all generated test cases. If the behavior of ES5 [[Put]] and proposed ES.next [[Put]] deviates, output is shown in red. Also, if any of these two behaviors deviates from your browser's built-in [[Put]] algorithm, output is shown in red.
  </p>
  <p>The test setup is as follows:
    <code>
<pre>
var parent = Object.create(null);
var child = Object.create(parent);
// setup child.x = 0 and/or parent.x = 0
child.x = 1
</pre>
    </code>The setup phase is parameterized with the following variables:
    <ul>
      <li>exists: one of "own", "inherited", "both" or "none". Describes whether <tt>x</tt> is already defined on the child (own), the parent (inherited), on both, or on neither (none).</li>
      <li>writable: a boolean indicating whether <tt>x</tt> is writable</li>
      <li>type: whether <tt>x</tt> is already defined as a "data" or "accessor" property</li>
      <li>extensible: a boolean indicating whether child is extensible</li>
    </ul>
    Each test case below shows the above parameters used to setup the test, then prints the value of <tt>child.x</tt> after the ES5 assignment, the ES.next assignment and the built-in assignment on this browser.
  </p>
  </div>
  <p>Test results:</p>
  <div id="report"></div>
</body>
</html>
